<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="/node_modules/axios/dist/axios.min.js"></script>
</head>
<body>
    <script type="text/javascript" >
        axios.interceptors.request.use(
            config=>{
                console.log("请求拦截1");
                // throw "异常"
                return config
            },
            error=>{
                console.log("请求拦截1失败了",error);
            }
        )

        axios.interceptors.request.use(
            config=>{
                console.log("请求拦截2");
                throw "异常"
                // return config
            },
            error=>{
                console.log("请求拦截2失败了",error);
            }
        )

        axios.interceptors.response.use(
            res=>{
                console.log("响应拦截1");
                return res
            }
        )

        axios.interceptors.response.use(
            res=>{
                console.log("响应拦截2");
                return res
            }
        )

        axios.get("http://127.0.0.1:8089/maoyan").then(value=>{
            console.log(value);
        })

    </script>
</body>
</html>